package com.wzy.pojo;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

@Data
@TableName("users")
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class User {
    @TableId(type = IdType.AUTO)//主键自增长
    private Integer id;//唯一id
    private String username;//用户名
    private String password;//密码
    private Integer isAdmin;//是否管理员
    private String email;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("registration_date")
    private Date registrationDate;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("last_login")
    private Date lastLogin;
    private String lastLoginIp;

    private String avatarUrl;

    @TableField("personal_description")
    private String description;

}
